<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page isELIgnored="false" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<jsp:include page="/admin/inc/incHead.jsp" flush="false"/>
<script>
    function noticeCheck() {/*管理员信息校验*/
        if (document.formAdd.noticeTitle.value.length < 1) {
            alert("请输入公告标题");
            document.formAdd.noticeTitle.focus();
            return;
        }
        var ue = UE.getEditor('container');
        if (ue.getContentTxt().length < 10) {
            alert("请输入公告内容,至少10字");
            return;
        }
        document.formAdd.submit();
    }
</script>
<div class="row">
    <div class="col-sm-12">
        <form name="formAdd" method="post" action="/notice/noticeAdd.action">
        <div class="row">
            <div class="col-sm-10">
                <div class="input-group">
                    <div class="input-group-addon">标题</div>
                    <input class="form-control" type="text" name="noticeTitle"/>
                </div>
            </div>
            <div class="col-sm-2">
                <div class="input-group">
                    <div class="input-group-addon">置顶级别</div>
                    <select class="form-control" name="noticeTop">
                        <option value="0" selected="selected">不置顶</option>
                        <option value="3">高</option>
                        <option value="2">中</option>
                        <option value="1">低</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <script id="container" name="noticeInfo" type="text/plain"></script>
            </div>
        </div>
    <div class="row">
        <div class="col-sm-1 col-sm-offset-11">
            <input href="#" class="btn btn-info" type="button" onclick="noticeCheck()" value="发布公告"
                   style="margin-top: 10px;"/>
        </div>
    </div>
        </form>
</div>
</div>
<script>
    var ue = UE.getEditor('container');
    ue.ready(reParentSize);
</script>
<jsp:include page="/admin/inc/incFoot.jsp" flush="false"/>
